import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.select import Select

driver = webdriver.Edge()

url = "https://www.baidu.com/"

driver.get(url)

element = driver.find_element(By.ID,"kw")

# 输入美女
element.send_keys("美女")
time.sleep(2)
# 全选
element.send_keys(Keys.CONTROL,"a")
time.sleep(2)
# 复制
element.send_keys(Keys.CONTROL,"c")
time.sleep(2)
# 删除
element.send_keys(Keys.BACKSPACE)
time.sleep(2)
# 粘贴
element.send_keys(Keys.CONTROL,"v")
time.sleep(2)
# 回车
element.send_keys(Keys.ENTER)

time.sleep(5)
driver.quit()